<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="style.css"/>
        <script src="alert.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
        <button type="button">是否进入百度页面！</button>
        <script type="text/javascript">
            var btn = document.querySelector("button");
            btn.onclick = function(){
                wtalert({
                    title:"警告!",
                    content:"是否跳转至百度!",
                    confirmFn:function(){
                        location.href = "http://www.baidu.com";
                    },
                    cancelFn:function(){
                        var h1 = document.createElement('h1');
                        h1.innerHTML = "用户已取消操作!";
                        document.body.appendChild(h1);
                    }
                });
            }

        </script>
    </body>
</html>